import os
from environs import Env


basedir = os.path.abspath(os.path.dirname(__file__))

class Config(object):
    
    env = Env()
    env.read_env()

    # definition of flask
    API_HOST = env.str('API_HOST', '0.0.0.0')
    API_PORT = env.int('API_PORT', 5000)
    API_THREADED = env.bool('API_THREADED', True)

    #flask wtf
    SECRET_KEY = env.str('SECRET_KEY', 'you-will-never-guess')

    #sql
    SQLALCHEMY_DATABASE_URI = env.str('DATABASE_URL', 'sqlite:///'+os.path.join(basedir, 'app.db'))
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    #post
    POST_PER_PAGE = env.int('POST_PER_PAGE', 3)

